package org.example.gateway.exceptions;

import org.example.gateway.enums.GatewayExceptionEnum;

public class GatewayException extends RuntimeException {
    private int code;
    private String errorMessage;

    public GatewayException(GatewayExceptionEnum exceptionEnum) {
        super(exceptionEnum.getMsg());
        this.code = exceptionEnum.getCode();
        this.errorMessage = exceptionEnum.getMsg();
    }

    public GatewayException(String errorMessage) {
        super(errorMessage);
        this.errorMessage = errorMessage;
    }

    public GatewayException(int code, String errorMessage) {
        this.code = code;
        this.errorMessage = errorMessage;
    }

    public Integer getCode() {
        return code;
    }

    public String getErrorMessage() {
        return errorMessage;
    }
}
